package com.gml.design.other.strategy;

/**
 * @ClassName : WidthComparator
 * @Description : 宽比较器
 * @Author : gml
 * @Date: 2021-04-02 16:56
 */
public class WidthComparator implements Comparator<Cat>{
    @Override
    public int compare(Cat o1, Cat o2) {
        if (o1.getWidth() < o2.getWidth())
            return -1;
        else if (o1.getWidth() > o2.getWidth())
            return 1;
        else
        return 0;
    }
}
